/**
 * 
 */
package org.mspring.mlog.api.spider.service;

import java.util.List;

import org.mspring.mlog.api.spider.entity.SpiderPost;
import org.mspring.platform.dao.hibernate.IGenericDao;

/**
 * @author Gao Youbo
 * @since 2013-5-3
 * @description
 * @TODO
 */
public interface SpiderPostService extends IGenericDao<SpiderPost, Long> {

    /**
     * 采集文章
     * 
     * @param spiderPost
     * @return
     */
    SpiderPost createSpiderPost(SpiderPost spiderPost);

    /**
     * 判断采集文章是否存在
     * 
     * @param sourceUrl
     * @return
     */
    boolean exists(String sourceUrl);

    /**
     * 变更发布状态
     * 
     * @param posted
     * @param id
     */
    void changePosted(Boolean posted, Long... id);

    /**
     * 发布文章
     * 
     * @param author
     * @param catalog
     * @param post
     */
    void publishPost(Long author, Long catalog, SpiderPost post);

    /**
     * 根据发布规则查找文章
     * 
     * @param publishRuleId
     * @return
     */
    List<SpiderPost> findByPublishRule(Long publishRuleId);
}
